﻿@model KnowledgeCommunity.Model.Commodity

@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Layout_zone.cshtml";
}

<div class="contentcontainer">
    <div class="headings">
        <h2>创建</h2>
    </div>
    <div class="contentbox">
        @using (Html.BeginForm("Create", "Commodity", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.ValidationSummary(true)

            <table>
                <tr>
                    <th width="200px">商品名称（*）</th>
                    <td>
                      @Html.TextBoxFor(model => model.Title, new { @class = "myInput_text" })
                    </td>
                </tr>
                <tr>
                    <th width="200px">商品原价（*）</th>
                    <td>
                      @Html.TextBoxFor(model => model.OriginalPrice, new { @class = "myInput_text" })
                    </td>
                </tr>
                <tr>
                    <th width="200px">商品现价（*）</th>
                    <td>
                      @Html.TextBoxFor(model => model.CurrentPrice, new { @class = "myInput_text" })
                    </td>
                </tr>
                <tr>
                    <th width="200px">商品数量（*）</th>
                    <td>
                      @Html.TextBoxFor(model => model.Count, new { @class = "myInput_text" })
                    </td>
                </tr>
                <tr>
                   <th>商品LOGO(*)</th>
                   <td>
                       <input type="file" id="c_file" name="logofile" />
                   </td>
                </tr>
                <tr>
                    <th>商品类型</th>
                    <td>
                        @{
                             List<SelectListItem> selectList = new List<SelectListItem>();
                             selectList.Add(new SelectListItem { Text = "--请商品类型--", Value = "0", Selected = true });
                             foreach (object e in Enum.GetValues(typeof(KnowledgeCommunity.Service.Enum.GoodType)))
                             {
                                 selectList.Add(new SelectListItem { Text = Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.GoodType), e), Value = ((int)e).ToString() });
                             }
                             @Html.DropDownList("GoodType", selectList);
                         } 
                    </td>
                </tr>
                <tr>
                   <th>商品简介(*)</th>
                   <td>
                       @Html.TextAreaFor(model => model.Content, new { @class = "myInput_area_slider" })
                   </td>
                </tr>
                <tr>
                   <th></th>
                   <td>
                    <input type="button" title="取消" value="<< 返回" id="GoBackList" onclick="history.go(-1)" />
                    <input class="btn" title="创建" value="确认创建 >> " type="submit" />
                   </td>
                </tr>
            </table>
        }  
        <div style="clear: both;"></div>
    </div>
</div>

<script type="text/javascript">
    CKEDITOR.replace('Content');
</script>

